package com.qf.air.controller;

import com.qf.air.service.AirService;
import com.qf.air.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * 统计报表需要的数据
 */
@RestController
@RequestMapping("/echarts")
@CrossOrigin(allowCredentials = "true")
public class EchartsController {

    @Autowired
    private AirService airService;

    // 北京各个区的空气质量检测条数
    @GetMapping("/district-air-quality-count")
    public String provinceSmsCountTopFive() throws IOException {
        //1. 调用Service查询数据
        String result = airService.findDistrictAirQualityCount();
        //2. 返回service查询到的数据
        return result;
    }

}
